<?php

//log all search params to siteSearches.log
function logSelected( $zipCode, $siteSelected, $timeStamp, $ip )
{
	$fHandle = fopen("../siteSearches.log", "w");
	
	//format parameters
	$params = "logged selection, " . $zipCode . ", " . $siteSelected . ", " . $timeStamp . ", " . $ip . "
	";
	
	$ok = "false";
	
	if( fwrite($fHandle, $params) )
	{
		$ok = "true";
	}
	
	fclose( $fHandle );
	
	
	return $ok;
}

function logSearch( $zipCode, $numResults, $timeStamp, $ip )
{
	$fHandle = fopen("../siteSearches.log", "w");
	
	//format parameters
	$params = "logged search, " . $zipCode . ", " . $numResults . ", " . $timeStamp . ", " . $ip . "
	";
	
	$ok = "false";
	
	if( fwrite($fHandle, $params) )
	{
		$ok = "true";
	}
	
	fclose( $fHandle );
	
	
	return $ok;
}

?>